var login = function(){	
			var userName=$("#username").val();
			var password = $("#passwd").val();
			var verCode = $("#verCode").val();
			
			if(userName==''){
				alert("请输入用户账号！");
				$("#username").focus();
				return;
			}
			if(password==''){
				alert("请输入用户密码！");
				$("#passwd").focus()
				return;
			}
			if(verCode==''){
				alert("请输入验证码！");
				 $("#verCode").focus();
				return;
			}
			var datajson = {"userName":userName,"pwd":password,"verCode":verCode};
			var url = 'ajaxlogin.action';
			
			$.ajax({
	            type: "POST",
	            url: url,
	            dataType: "json",
	            data: datajson,
	            success: responseLogin,
	            error: function () {
	                alert("登陆失败");
	            }
	        });
		}
var responseLogin = function(data, textStatus, jqXHR){
			
	if(data.status=="ok"){							
				window.location.href="main.action";
		}
		else if(data.status == "errVerCode"){
			alert("验证码输入错误！");
			 $("#verCode").focus();
		}else if(data.status == "nouser"){
			alert("用户账号不存在！");
			 $("#username").focus();
		}
		else if(data.status == "pwserror"){
			alert("用户密码错误！");
			 $("#passwd").focus();
		}
}